package day0717;

import com.sun.org.apache.bcel.internal.generic.ARETURN;

import java.util.Arrays;
import java.util.Random;

public class test {
    public static void main(String[] args) {
        String[] a = new String[]{"A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"};
        String[] c = b(a);
        //打乱c
        shuffle(c);
        System.out.println(Arrays.toString(c));
    }
    static String[] b(String[] a) {
        int d = 0;
        String[] e = new String[52];
        for (int i = 0; i < 4; i++) {
            System.arraycopy(a, 0, e, d, a.length);
            d = d + 13;
        }
        return e;
    }
    static void  shuffle(String[] c){
        for (int i = c.length-1  ; i >=0; i--) {
            int index=(int)(Math.random()*i);
            String temp = c[index];
            c[index] = c[i];
            c[i] = temp;
        }
    }
}
